<?php

/**
 * courseSorting actions.
 *
 * @package    Timetabler‏
 * @subpackage courseSorting
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class courseSortingActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->forward('default', 'module');
  }



 public function executeSort(sfWebRequest $request)
  {
     $subjects=array('informaion system','database','parallel computing'); 
     $count=3;// no. of courses 

    $this->form = new CourseSortingForm();
 
    if ($request->isMethod('post'))
    {
      $this->form->bind($request->getParameter('contact'));
      if ($this->form->isValid())
      {
        //$this->redirect('contact/index?'.http_build_query($this->form->getValues()));
           
        for ($i=0 ;$i<$count ; $i++)
         { // repalce withe insert to DB 
          echo  $this->form->getValue($subjects[$i]);
          echo  $this->form->getValue($i);
          echo  $this->form->getValue($i+$count);
         }
         
        

      }
    }




}//end function 

}// end class 
